import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 名单评分信息 */
export interface MarketingScore {
          phoneE164: string; // 号码
          score?: number; // 分数
  }

// 名单评分 API
export const MarketingScoreApi = {
  // 查询名单评分分页
  getMarketingScorePage: async (params: any) => {
    return await request.get({ url: `/vos/marketing-score/page`, params })
  },

  // 查询名单评分详情
  getMarketingScore: async (id: number) => {
    return await request.get({ url: `/vos/marketing-score/get?id=` + id })
  },

  // 新增名单评分
  createMarketingScore: async (data: MarketingScore) => {
    return await request.post({ url: `/vos/marketing-score/create`, data })
  },

  // 修改名单评分
  updateMarketingScore: async (data: MarketingScore) => {
    return await request.put({ url: `/vos/marketing-score/update`, data })
  },

  // 删除名单评分
  deleteMarketingScore: async (id: number) => {
    return await request.delete({ url: `/vos/marketing-score/delete?id=` + id })
  },

  /** 批量删除名单评分 */
  deleteMarketingScoreList: async (ids: number[]) => {
    return await request.delete({ url: `/vos/marketing-score/delete-list?ids=${ids.join(',')}` })
  },

  // 导出名单评分 Excel
  exportMarketingScore: async (params) => {
    return await request.download({ url: `/vos/marketing-score/export-excel`, params })
  },
}